/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};

/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {

/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId])
/******/ 			return installedModules[moduleId].exports;

/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			exports: {},
/******/ 			id: moduleId,
/******/ 			loaded: false
/******/ 		};

/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);

/******/ 		// Flag the module as loaded
/******/ 		module.loaded = true;

/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}


/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;

/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;

/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "/dist/";

/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';

	var _index = __webpack_require__(1);

	var _index2 = _interopRequireDefault(_index);

	function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

	(0, _index.init)(function () {
	  var _SDK = (0, _index2.default)();

	  var _SDK$UI = _SDK.UI;
	  var setNavHeader = _SDK$UI.setNavHeader;
	  var preViewImages = _SDK$UI.preViewImages;
	  var _SDK$systemAbility = _SDK.systemAbility;
	  var takeCamera = _SDK$systemAbility.takeCamera;
	  var takePhoto = _SDK$systemAbility.takePhoto;
	  var uploadToOSS = _SDK.file.uploadToOSS;


	  document.getElementById('setNavHeader').addEventListener('click', function () {
	    var config = {
	      left: {
	        left1: {
	          title: '杩斿洖',
	          callFunction: function callFunction() {
	            alert('鐐瑰嚮浜嗚繑鍥�');
	            mamp.UI.closeWebView();
	          }
	        },
	        left2: {
	          title: '鍏抽棴',
	          callFunction: function callFunction() {
	            alert('鐐瑰嚮浜嗗叧闂�');
	          }
	        }
	      },
	      title: '鏍囬1',
	      right: [{
	        title: '鎸夐挳1',
	        callFunction: function callFunction() {
	          alert('鐐瑰嚮浜嗘寜閽�1');
	        }
	      }, {
	        title: '鎸夐挳2',
	        callFunction: function callFunction() {
	          alert('鐐瑰嚮浜嗘寜閽�2');
	        }
	      }]
	    };
	    setNavHeader(config);
	  });
	  document.getElementById('preViewImages').addEventListener('click', function () {
	    preViewImages([{ url: 'http://pic41.nipic.com/20140509/18696269_121755386187_2.png', desc: '鎻忚堪鎻忚堪鎻忚堪鎻忚堪' }, { url: 'http://pic10.nipic.com/20101001/4438138_140843092127_2.jpg', desc: '鎻忚堪鎻忚堪鎻忚堪鎻忚堪' }], 1);
	  });
	  document.getElementById('takeCamera').addEventListener('click', function () {
	    takeCamera(function (ret) {
	      console.log(ret);
	    });
	  });
	  document.getElementById('takePhoto').addEventListener('click', function () {
	    takePhoto(function (ret) {
	      console.log(ret);
	    }, 3);
	  });
	  document.getElementById('uploadToOSS').addEventListener('click', function () {
	    takePhoto(function (ret) {
	      var imgs = ret.map(function (item) {
	        return item.url;
	      });
	      console.log(imgs);
	      uploadToOSS(imgs, function (ret) {
	        console.log('ok');
	        alert(JSON.stringify(ret));
	      }, function (err) {
	        console.log('error');
	        console.log(err);
	      });
	    }, 3);
	  });
	});

/***/ },
/* 1 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';

	Object.defineProperty(exports, "__esModule", {
	  value: true
	});
	exports.init = undefined;

	var _init = __webpack_require__(2);

	var _init2 = _interopRequireDefault(_init);

	var _sdk = __webpack_require__(3);

	var _sdk2 = _interopRequireDefault(_sdk);

	function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

	var mamp = {};

	window.mamp = mamp;

	exports.default = _sdk2.default;
	exports.init = _init2.default;

/***/ },
/* 2 */
/***/ function(module, exports) {

	'use strict';

	Object.defineProperty(exports, "__esModule", {
	  value: true
	});
	var INIT = false;

	exports.default = function (callback) {
	  if (INIT) {
	    alert('璇蜂笉瑕侀噸澶嶅垵濮嬪寲');
	    return;
	  }

	  var distUrl = 'mamp://injectionmamp/cordova.js';

	  var script = document.createElement("script");
	  script.src = distUrl;
	  document.head.appendChild(script);

	  window.close = function () {
	    window.location.href = 'mamp://close';
	  };

	  document.addEventListener("deviceready", callback, false);

	  INIT = true;
	};

/***/ },
/* 3 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';

	Object.defineProperty(exports, "__esModule", {
	  value: true
	});

	var _whiteList = __webpack_require__(4);

	var _whiteList2 = _interopRequireDefault(_whiteList);

	function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

	exports.default = function () {
	  var mamp = window.mamp;
	  var sdk = {};
	  Object.keys(_whiteList2.default).forEach(function (moduleName) {
	    var apis = _whiteList2.default[moduleName];
	    var module = mamp[moduleName];

	    if (module) {
	      sdk[moduleName] = {};
	      Object.keys(apis).forEach(function (apiKey) {
	        var api = apis[apiKey];

	        if (api) {
	          sdk[moduleName][apiKey] = module[apiKey];
	        }
	      });
	    }
	  });
	  return sdk;
	};

/***/ },
/* 4 */
/***/ function(module, exports) {

	"use strict";

	Object.defineProperty(exports, "__esModule", {
	  value: true
	});
	exports.default = {
	  UI: {
	    setNavHeader: true,
	    preViewImages: true
	  },
	  systemAbility: {
	    takeCamera: true,
	    takePhoto: true
	  },
	  file: {
	    uploadToOSS: true
	  }
	};

/***/ }
/******/ ]);